package router

import (
	mysql "gin_easy_starter/internal/repository"
	"gin_easy_starter/pkg/env"
	"github.com/IBM/sarama"
	"github.com/gin-gonic/gin"
	"github.com/go-redis/redis/v8"
	"go.uber.org/zap"
)

type Server struct {
	Engine        *gin.Engine
	Db            mysql.Repo
	logger        *zap.Logger
	KafkaConsumer sarama.Consumer
	RedisClient   *redis.Client
}

func NewHttpServer() (*Server, error) {

	env.GetActive()

	server := new(Server)
	r := gin.Default()

	server.Engine = r
	setApiRouter(r)

	return server, nil
}
